<?php
class Pageley_Domain_Attribute_Decorator extends Pageley_Domain_Attribute_Basic {

    private $attribute;

    public function __construct($attribute, $validators) {
        parent::__construct($attribute->getName(), $validators);
        $this->attribute = $attribute;
    }

    public function validate($value, $propertyName, $target) {
        parent::validate($value, $propertyName, $target);
        $this->attribute->validate($value, $propertyName, $target);
    }

    public function isMultiple() {
        return $this->attribute->isMultiple();
    }

    public function isReference() {
        return $this->attribute->isReference();
    }

    public function isEager() {
        return $this->attribute->isEager();
    }
    
    public function isRequired() {
        return $this->attribute->isRequired();
    }

    public function newProperty($entity) {
        return $this->attribute->newProperty($entity);
    }

    public function isComposite() {
        return $this->attribute->isComposite();
    }

    public function shouldEncrypt() {
        return $this->attribute->shouldEncrypt();
    }

    public function getAttribute($propertyName) {
        return $this->attribute->getAttribute($propertyName);
    }

    public function getAttributes() {
        return $this->attribute->getAttributes();
    }

    public function isInstance($value) {
        return $this->attribute->isInstance($value);
    }

    public function newInstance($properties) {
        return $this->attribute->newInstance($properties);
    }

    public function getDecoratedAttribute() {
        return $this->attribute;
    }
    
    public function equals($attribute) {
        return $this->attribute->equals($attribute);
    }
    
    public function getType() {
        return $this->attribute->getType();
    }
    
    public function getConverter() {
        return $this->attribute->getConverter();
    }
}